using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Microsoft.Xna.Framework.Input;
using Evolution.Engine.Managers;
using Evolution.Engine.Interfaces;

namespace Evolution.Engine.Keymapping
{
    public class KeyAssignments
    {
        protected Hashtable myKeyAssignments = new Hashtable();
        
        public bool Pressed(string moveMent)
        {
            return InputManager.Instance.KeyboardState.IsKeyDown(this[moveMent].Key);
        }

        public KeyAction this[string moveMent]
        {
            get
            {
                return (KeyAction)myKeyAssignments[moveMent];
            }
        }

        public KeyAssignments(PlayerType player)
        {
            ScriptManager.Instance.Get<IKeyAssignments>("Content/Scripts/KeyAssignments.script", "Scripts").LoadKeyAssignment(player, ref myKeyAssignments);
        }
    }
}
